package com.hdu.kdk_es_orm.core;

import lombok.Data;

import java.util.Collection;
import java.util.List;


@Data
public class QueryFilter {

    private String field;
    private String exp;

    private FilterType type;

    private List<QueryFilter> must;
    private List<QueryFilter> mustNot;
    private List<QueryFilter> should;

    private Collection<?> in;
    private Collection<?> notIn;
    private Object eq;
    private Object notEq;
    private Object lt;
    private Object lte;
    private Object gt;
    private Object gte;
    private Object like;
    private Object likeLeft;
    private Object likeRight;
    private Object notLike;
    private Object notLikeLeft;
    private Object notLikeRight;

    public QueryFilter type(FilterType type) {
        this.type = type;
        return this;
    }
    public QueryFilter field(String field) {
        this.field = field;
        return this;
    }
    public QueryFilter exp(String exp) {
        this.exp = exp;
        return this;
    }
    public QueryFilter must(List<QueryFilter> must) {
        this.must = must;
        return this;
    }
    public QueryFilter mustNot(List<QueryFilter> mustNot) {
        this.mustNot = mustNot;
        return this;
    }
    public QueryFilter should(List<QueryFilter> should) {
        this.should = should;
        return this;
    }
    public QueryFilter in(Collection<?> in) {
        this.in = in;
        return this;
    }
    public QueryFilter notIn(Collection<?> notIn) {
        this.notIn = notIn;
        return this;
    }
    public QueryFilter eq(Object eq) {
        this.eq = eq;
        return this;
    }
    public QueryFilter notEq(Object notEq) {
        this.notEq = notEq;
        return this;
    }
    public QueryFilter lt(Object lt) {
        this.lt = lt;
        return this;
    }
    public QueryFilter lte(Object lte) {
        this.lte = lte;
        return this;
    }
    public QueryFilter gt(Object gt) {
        this.gt = gt;
        return this;
    }
    public QueryFilter gte(Object gte) {
        this.gte = gte;
        return this;
    }
    public QueryFilter like(Object like) {
        this.like = like;
        return this;
    }
    public QueryFilter likeLeft(Object likeLeft) {
        this.likeLeft = likeLeft;
        return this;
    }
    public QueryFilter likeRight(Object likeRight) {
        this.likeRight = likeRight;
        return this;
    }
    public QueryFilter notLike(Object notLike) {
        this.notLike = notLike;
        return this;
    }
    public QueryFilter notLikeLeft(Object notLikeLeft) {
        this.notLikeLeft = notLikeLeft;
        return this;
    }
    public QueryFilter notLikeRight(Object notLikeRight) {
        this.notLikeRight = notLikeRight;
        return this;
    }

}

